package com.kuolie.answer.controller;
import com.kuolie.answer.utils.AccessTokenUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/token")
public class TokenController {


    @RequestMapping(value = "/getToken", method = RequestMethod.POST)
    @ResponseBody
    public String getToken(String path,String ctbh){
        String access_token = AccessTokenUtil.getAccessToken();
        System.err.println(access_token);
        String scene="helloWord";
        String page=path;
        String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="+access_token;//+"&scene="+scene+"&page="+page;
        String is=AccessTokenUtil.httpRequestPost(url,access_token,scene,page);
        return is;
    }
}
